<?php

namespace app\company\validate;


class StoreUserValidate extends BaseValidate
{
    public function __construct()
    {
        $rule = [
            'real_name'   => 'require|max:30',
            'mobile'      => 'require|mobile',
            'supplier_id' => 'require'
        ];

        $message = [
            'real_name.require'   => '请输入真实姓名',
            'real_name.max'       => '真实姓名最多不能超过20个字符',
            'mobile.require'      => '请输入手机号',
            'mobile.mobile'       => '手机号格式错误',
//            'mobile.unique'       => '手机号已存在',
            'supplier_id.require' => '请选择所属经销商'
        ];

        $scene = [
//            'add' => ['real_name', 'mobile', 'supplier_id'],
            'add' => ['real_name', 'mobile'],
        ];
        parent::__construct($rule, $message, $scene);
    }
}